import React, { useState } from 'react'
// connect 高阶组件  用来来接组件与redux之间的关系
import { connect } from 'react-redux';
function Home(props) {
   console.log(props)
   let {num,dispatch,name} = props;
    return (
      <div>
            <div>Home---{num}---{name}</div>
            <button onClick={()=>{
                dispatch({
                    type:"ADD",
                    num:1
                })
            }}>add</button>
      </div>
    )
  }
export default connect((state)=>{
    console.log(state)
    return state
})(Home)
